Signal conditioning for variable focus optical reader

ABSTRACT

A method and apparatus for conditioning an input signal from an optical detector includes a controller for dynamically modifying adjustable delay elements connected to the input signal, thereby modifying characteristics of the signal conditioning circuitry. The method and apparatus determines the transitions between binary levels of an input signal such as a scanned bar code label by detecting zero crossings of an approximated second derivative of the input signal. Samples of the input signal are obtained by using delay lines, sample-and-hold circuits, an analog shift register or similar device. The first derivative of the signal is approximated by the slope of a straight line between two sampled points on the waveform. The second derivative is approximated by the difference between two first derivatives. Zero crossings of the second derivative indicating transitions of the input signal may be determined either by detecting a signal peak on both sides of the zero crossing, or by comparing the second derivative signal to zero when the first derivative exceeds a positive or negative threshold. The amount of shift in the zero crossings may be estimated by measuring relative amplitudes or widths of the surrounding signal lobes. The time between sample points may be adjusted to match a particular range setting of a scanner having a plurality of range settings.

This application is a continuation-in-part of application Ser. No.08/058,659 filed on May 7, 1993 now U.S. Pat. No. 5,463,211.

FIELD OF THE INVENTION

The field of the present invention relates to signal processing and,more particularly, to a method and apparatus for determining theoccurrence of transitions in a binary encoded input signal such as ascanned bar code label.

BACKGROUND OF THE INVENTION

Signals having transitions between binary levels are generated from manydifferent devices. For example, optical scanners have been used to readencoded information on bar code labels and generate analog signalscomprised of substantially binary levels. Bar codes typically consist ofa series of parallel light and dark rectangular areas of varying widths.The light areas are often referred to as "spaces" and the dark areas as"bars". Different widths of bars and spaces are selected in order todefine different characters of a bar code.

A bar code label is typically read by a scanner which detects reflectedand/or diffracted light from the bars and spaces comprising thecharacters. One common method of illuminating the bar code label is byuse of a scanning laser beam, in which case the reflected light isdetected by an optical detector. The detector generates an electricalsignal having an amplitude determined by the intensity of the collectedlight. Another method for illuminating the bar code label is by use of auniform light source with an array of optical detectors connected to ananalog shift register (commonly called a charge-coupled device or CCD).In such a technique, as with a scanning laser, an electrical signal isgenerated having an amplitude determined by the intensity of thecollected light. In either the scanning laser or CCD technique, theamplitude of the electrical signal has one level for dark bars and asecond level for light spaces. The precise amplitudes of the two levels,however, are not known prior to scanning. As a label is scanned,positive-going transitions and negative-going transitions in theelectrical signal occur, signifying transitions between bars and spaces.The transitions in the electrical signal are not perfectly sharp but maybe gradual or noisy, thus making it difficult to determine the preciseinstant at which the transition has occurred. Inaccuracies indetermining transition points may cause a bar code label to be misread.

Several techniques in signal processing have been developed for thepurpose of determining transitions with greater accuracy. One suchtechnique involves the detection of zero crossings of the second timederivative of the input signal. The benefits of using a secondderivative signal processing method for bar code readers are well knownand are set forth, for example, in U.S. Pat. No. 4,000,397 entitled"Signal Processor Method and Apparatus" (issued Dec. 28, 1976).

Derivatives of the input signal in scanning systems are typicallygenerated in an analog fashion by RC circuits. Differentiation circuitsfor obtaining analog derivatives of the input signal are well known bythose skilled in the art and primarily comprise one or more operationalamplifiers along with resistors and capacitors. Such differentiationcircuits implement for the first derivative a transfer function having azero at the origin and a single pole chosen beyond the highest frequencyof interest. For the second derivative, such circuits implement atransfer function having two zeros at the origin and two poles chosenbeyond the highest frequency of interest.

As the demand for accuracy and versatility in scanners continues togrow, conventional implementation methods of the second derivativetechnique may experience limitations. One such limitation is the abilityto reject noise in the high frequency regions. As system performance isstrongly affected by noise present in such regions, conventionalimplementations usually require the addition of a relatively complex lowpass filter in the signal processing chain. Further, susceptibility tonoise interference is affected by the fact that, while noise power tendsto increase at higher frequencies, input signal power tends to roll offat such frequencies. The differentiation operation used in theconventional method to obtain the first or second derivative signalsprovides little or no attenuation outside the bandwidth of interest(i.e., the frequency band that contains most of the energy resultingfrom the light reflected from the symbol) and is therefore susceptibleto high frequency noise.

A second limitation, related to the first, is that the conventionaldifferentiator circuit does not exhibit flat group delay, or linearphase response, over the frequency band of interest. Group delay may bedefined as the delay time of a circuit or system at various frequencyvalues. A system exhibiting "flat" group delay has a relatively uniformdelay time over the bandwidth of interest. Such a system is thereforesaid to have linear phase response. A system that does not exhibit flatgroup delay has relatively nonuniform or varying delay times dependentupon input signal frequency. Such a system is therefore said to havenonlinear phase response. Bar code scanner systems utilizingconventional differentiator circuits may, as a result of not having flatgroup delay, distort pulse shapes leading to errors in detecting pulsewidths.

This type of distortion may be illustrated with reference to FIG. 1.FIG. 1 is a graph comparing the output O₁ of a low pass filter havingnonconstant group delay compared to the output O₂ of an ideal filterhaving linear phase response or constant group delay in response to aninput pulse P. The output O₁ of the filter with nonconstant group delayexhibits asymmetry and over/undershoot resulting from a nonlinear phasecharacteristic, possibly leading to incorrect or unsuccessful decodingof the symbol. To avoid distorting the shapes of pulses that occur in abar code signal processing system, it is thus highly desirable that theentire system exhibit linear phase response or, equivalently, constantgroup delay.

Another related problem may occur while attempting to detect the zerocrossings of the second derivative signal. Typically, the firstderivative of the input signal is looked to in order to determine thetime periods during which a valid zero crossing of the second derivativesignal may occur. Zero crossings of the second derivative signal areconsidered valid if occurring during a portion of the first derivativesignal peak. However, a common problem in conventional systems is thatthe first and second derivative signals are not properly aligned in timebecause of temperature and frequency dependent delays in the first andsecond differentiator circuitry. Significant misalignment of the firstand second derivative signals may occur causing missed zero crossings ordetection of false zero crossings of the second derivative signal.

Further problems have been created by increasing demand for greaterdepth of field in handheld scanners. Greater depth of field requirementsresult in a larger range of signal amplitudes leading to the potentialfor clipping of the input signals or derivative signals. Clippingtypically occurs when a signal is limited by a positive or negativevoltage supply level. Although enlarging the supply voltage may increasethe dynamic range of operation and thereby minimize clipping, there isalso a benefit in keeping power and voltage levels low to accommodatesmaller, lighter and cheaper handheld scanners. Moreover, greater depthof field in scanners further accentuates the noise problems mentionedabove as higher frequencies are generated as a result of using smallerlabels and reading labels at longer distances. Reading labels at longerdistances also reduces the strength of the input signal thus increasingthe need to reduce the effects of noise.

SUMMARY OF THE INVENTION

The invention provides in one aspect a symbol reader having a variablefocusing distance with adjustable signal conditioning circuitry forprocessing an input signal. In one embodiment, a symbol reader has aplurality of discrete focal distances. An optical detector outputs asignal having an amplitude varying in response to an amount of detectedlight. The signal output from the optical detector is conditioned byadjustable signal conditioning circuitry such as adjustable delayelements. First and second derivatives of the optical detector signalare calculated from delayed representations generated by the adjustabledelay elements.

The present invention in another aspect provides a method and apparatusfor detecting the transitions between binary levels of an input signal.The preferred method of the invention is based on approximating thederivative operation with the mathematical operation:

    F(t)-F(t-D)

where F(t) is the electrical signal that represents the reflected lightfrom the symbol, t is the time variable and D is a fixed time delay. Thederivative of the signal is in effect approximated by the slope of astraight line between two points on the waveform separated by the delaytime D.

In one embodiment the delayed version of the signal is obtained from acircuit element known as a delay line. A primary benefit of thistechnique is that delay lines, by definition, have constant group delay(and therefore linear phase) over the entire range of operation. Thefrequency response of the delay line differentiator is a periodic typeresponse (often called a "comb" filter). The first null in the responseis given by the formula f(min)=1/D where D is the delay time of thedelay element and f(min) is in Hertz. If the delay time is chosen sothat the frequency response has begun to decrease immediately beyond thefrequencies of interest, the system has the advantageous property ofreducing the amplitude of high frequency noise components whileperforming the differentiating function. In addition, as mentionedabove, such filtering is done with completely linear phase.

The above concepts are further extended to obtain a second derivativesignal using two delay elements. The signals entering the circuit,exiting the first delay element and exiting the second delay element arereferred to as A, B and C respectively. The numerical approximation tothe first derivative is the difference between two adjacent samples orA-B. Another approximate first derivative is calculated by B-C. Anapproximation of the second derivative is calculated from the differencebetween the two first derivatives, or:

    (A-B)-(B-C)=A+C-2B

A summing amplifier may be used to perform the arithmetic operations toproduce an approximation to the second derivative. The frequencyresponse of this delay line second derivative circuit is also of a combfilter variety and has the advantageous property of reducing theamplitude of high frequency noise components while performing thedifferentiating function.

Once the second derivative signal is obtained in the above fashion,transitions between spaces and bars may be determined by locating thezero crossings of the second derivative signal in a manner such as thatused in U.S. Pat. No. 4,000,397, incorporated herein by reference, or byvarious other techniques further explained herein. An important benefitof delay line differentiation is that, by virtue of the fixed delayintervals, the first and second derivatives are properly aligned in timesuch that the peak amplitude of the first derivative may be used toassist detection of the second derivative zero crossings. A furtheradvantage of the above technique is the ability to maintain a suitabledynamic range of operation while minimizing sensitivity to clipping ofsignal amplitudes. Dynamic range is improved because the secondderivative signal is derived independently from the first derivativesignal; thus, clipping of the first derivative signal will not affectthe precision of the second derivative signal.

An embodiment may also include an additional low pass filter in thesystem for attenuating any undesired high frequency noise beyond thebandwidth of interest. Such a filter need not have linear phase responsebeyond the bandwidth of interest and may therefore be a simple, wellknown filter type (such as a four-pole transitional Gaussian 12-dB)without degrading the shape of the signal pulses and providing, incombination with the delay line differentiator, superior overall systemfrequency response and group delay characteristics.

In another embodiment of the present invention the delay elements may beimplemented as active all pass filters and therefore have the advantageof being easily adjusted to compensate for phase nonlinearities thatarise in other parts of the system. In yet another embodiment, the delayperiods may be adjustable so as to enable accurate scanning over agreater depth of field.

A zero crossing detector is provided in one embodiment whereby a validzero crossing is determined by detecting a preceding signal peak and asubsequent, opposite-polarity signal peak of a minimum amplitude apredefined distance surrounding the zero crossing. In a particularversion of this embodiment, the second derivative signal is applied to aseries of two delay elements. The output of the first delay element istested for zero crossings, while the input to the delay element seriesand the output of the delay element series are tested for positive andnegative signal peaks meeting the specified criteria.

In several variations of the above embodiment, means are provided tocompensate for intersymbol interference. In one variation, the peaksignal values are measured and used to derive an estimate of the slopeof the second derivative signal at the zero crossing. The calculatedslope is applied to a look-up table to obtain a zero-crossing correctionfactor. In another variation, the peak signal values are compared. Thedifference value is applied to a look-up table to obtain a zero-crossingcorrection factor. In another variation, relative widths of the positiveand negative signal pulses are compared. The difference value may beapplied to a look-up table to obtain a zero-crossing correction factor,or may be halved and used as an estimate of zero crossing displacement.

The foregoing and other objects, features, and advantages of theinvention will become apparent from the following more detaileddescription set forth in conjunction with the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a graph comparing the outputs of a linear phase and nonlinearphase low pass filter circuit when provided with a pulse input.

FIG. 2a is a system diagram of a preferred embodiment in accordance withthe present invention.

FIG. 2b is a graph of waveforms representative of the operation of thesystem of FIG. 2a.

FIG. 2c is a graph of waveforms showing the relative time alignment ofthe first and second derivative signals in a conventional signalprocessing system when misalignment occurs.

FIG. 2d is a graph of waveforms representative of the operation of asystem in FIG. 2a when clipping of the first derivative signal occurs.

FIG. 2e depicts waveforms showing distortion of the second derivativesignal in a conventional signal processing system when clipping of thefirst derivative signal occurs.

FIGS. 3a-3f are detailed schematics of the system in FIG. 2a. FIG. 3g isa system diagram of a preferred embodiment of the present inventionincorporating the detailed circuits depicted in FIGS. 3a-3f.

FIGS. 4a and 4b are graphs comparing the logarithmic and linearfrequency responses, respectively, of a delay line differentiator withthat of a conventional differentiator.

FIGS. 5a and 5b are graphs comparing the logarithmic and linearfrequency responses, respectively, of a delay line double differentiatorof the system in FIG. 2a that of a conventional second derivativecircuit.

FIG. 6a is a graph comparing the delay time responses of a delay linedifferentiator with that of a conventional analog differentiatorcircuit.

FIG. 6b is a graph comparing the delay time responses of a delay linedouble differentiator of the system in FIG. 2a with that of aconventional analog double differentiator circuit.

FIG. 7 is a graph showing the frequency response of a typical Gaussian12-dB low pass filter.

FIG. 8a is a graph comparing the frequency response of a delay linedifferentiator according to the present invention with a conventionalanalog differentiator circuit after addition of the low pass filterstage of FIG. 7.

FIG. 8b is a graph comparing the frequency response of a delay linedouble differentiator of the system in FIG. 2a with a conventionalanalog double differentiator circuit after addition of the low passfilter stage of FIG. 7.

FIG. 9a is a block diagram of a circuit using delay lines to detect zerocrossings of a signal.

FIG. 9b is a waveform diagram illustrating the operation of the circuitshown in FIG. 9a.

FIG. 9c is a waveform diagram depicting asymmetries caused byintersymbol interference.

FIG. 10 is a timing diagram for the embodiment of FIG. 9a.

FIG. 11 is a graph showing a range of phase compensation (i.e., groupdelay adjustment) by adjustment of resistive components.

FIG. 12 is a system diagram of an alternative embodiment of the presentinvention wherein zero crossing of the second derivative are determinedwithout generating a first derivative of the input signal.

FIG. 13a is a block diagram showing an alternative embodiment of thepresent invention with sample-and-hold circuits.

FIGS. 13b-d are more detailed schematics of the alternative embodimentshown in FIG. 13a.

FIGS. 13e-f are timing diagrams used in conjunction with the alternativeembodiment shown in FIG. 13b.

FIG. 14 is a block diagram of an embodiment of the present inventionemploying a plurality of delay lines to generate a more preciseapproximation of a second derivative from a sampled input signal.

FIG. 15 is a block diagram of an alternative embodiment of the presentinvention including a scanner having a plurality of range settings andhaving delay periods adjustable to a particular range setting.

FIGS. 16a-16c are waveform diagrams showing the effect of intersymbolinterference.

FIG. 17 is a block diagram of a circuit for determining the shift in azero crossing point due to intersymbol interference.

FIG. 18 is a block diagram of another circuit for determining the shiftin a zero crossing point due to intersymbol interference.

FIGS. 19-21 are waveform diagrams illustrating the principles behindseveral of the disclosed techniques for correcting shift in the zerocrossing point.

FIG. 22 is a block diagram of a third circuit for determining the shiftin a zero crossing point due to intersymbol interference.

FIG. 23 is a diagram showing application of a correction factor tocorrect shift in the measured zero crossing point.

FIG. 24 is a block diagram of a fourth circuit for determining the shiftin a zero crossing point due to intersymbol interference.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

The preferred embodiments will now be described in reference to thedrawings. FIG. 2a is a system diagram of a preferred signal processor.The operation of the system shown in FIG. 2a is explained in part withreference to the waveforms shown in FIG. 2b. When a bar code label (notshown) is read, an optical detector 1 detects light from the bars andspaces comprising the characters. The optical detector 1 generates anelectrical input signal Vin having an amplitude determined by theintensity of reflected light incident upon the optical detector 1. Theamplitude of the input signal Vin, as shown in FIG. 2b, generally hasone level L1 for dark bars and a second level L2 for light spaces. Theprecise amplitudes of those levels L1 and L2 are typically unknown. Thepositive-going transitions and negative-going transitions of inputsignal Vin thus signify transitions between bars and spaces. Thetransitions in the input signal Vin are not perfectly sharp but may begradual or have high frequency noise, thus making it difficult todetermine the precise instant at which the transition has occurred.

The input signal Vin is sent from the optical detector 1 to a low-passfilter 2. The low-pass filter 2 is connected to a first delay element 3which is in turn connected to a second delay element 4. The outputs ofthe low-pass filter 2 and the second delay element 4 are connected to afirst summing circuit 5. The outputs of the low-pass filter 2 and bothdelay elements 3 and 4 are also connected to a second summing circuit 6.The summing blocks 5 and 6, as described in more detail herein, operateon those signals to produce an approximate first derivative signal V1and an approximate second derivative signal V2, respectively, as shownon FIG. 2b. The first derivative signal V1 is sent to a peak detector 7.The output of the peak detector 7 and the approximate first and secondderivative signals V1 and V2 are sent to a zero crossing detector 8 inorder to determine zero crossings of the second derivative signal V2 ina manner described in more detail herein. The zero crossing detector 8sends information to decoding logic 9 which decodes the bar code label.

A more detailed embodiment is shown in FIGS. 3a-3f. Referring to FIG.3a, the signal on input line 21 corresponds to Vin on FIG. 2a and isthus representative of an encoded analog signal such as may be generatedby detecting reflected light from a bar code symbol that has beenscanned by a moving laser beam. The frequency of the signal on inputline 21 is generally a function of various factors including spot size,the angular velocity of the scanning beam, the distance of the labelfrom the scanner, and the size of the label. In the case of a CCDscanner, the input frequency is proportional to the frequency of theclock driving the CCD device. The typical range of frequency varies from1 kHz to 100 kHz.

The signal on input line 21 is connected to a low pass filter such as afour-pole transitional Gaussian 12-dB filter 21 having a breakpoint atapproximately 85 kHz. Such a filter is of a relatively simple andwell-known design (see, e.g., Arthur Williams, "Filter Design Handbook"(1981)) and exhibits fairly constant group delay over the low frequencybandwidth of interest, after which the frequency response drops offsteeply and group delay is no longer constant. The four-poletransitional Gaussian 12-dB filter 22 is comprised of two similar stagesinvolving operational amplifiers X9 and X10, which in one embodiment aremodel type TLC272 as manufactured by Texas Instruments. The output ofthe operational amplifier X10 provides a filtered input signal on line23. The function of the filter 22 in conjunction with the rest of thesystem will be more fully explained later.

The filtered input signal on line 23 then enters a first delay element24 which delays the signal on line 23 for an amount of time such as 2.75microseconds. The first delayed signal on line 25 at the output of thefirst delay element 24 then enters a second delay element 26 whichdelays the first delayed signal on line 25 for another amount of timesuch as 2.75 microseconds. The output from second delay element 26 is asecond delayed signal on line 27.

The delay elements 24 and 26 are preferably identical and may beimplemented as passive or active RLC circuits or by techniques based onphysical propagation time (e.g., transmission lines or surface acousticwave devices). Active delay elements utilizing operational amplifiersare preferred because they are relatively cheap, are less sensitive tonoise than inductors used in passive delay filters, and are suitable forthe bandwidth of interest. The construction of active and passiveelectrical delay elements may be performed by one skilled in the art(see, e.g., Arthur Williams, "Filter Design Handbook" (1981)). As anexample, the delay elements 24 and 26 may be implemented as two-poleall-pass filters of the 0.05 degree equi-ripple error family. In oneembodiment, the operational amplifiers X16, X17, X18 and X19 are modeltype TLC274 as manufactured by Texas Instruments. As delay elements 24and 26 are of identical design, they may be advantageously located on asingle integrated chip so that operating conditions such as temperaturewill affect the delay time of both delay elements 24 and 26 equally.

It should be noted that the length of the delay periods of delayelements 24 and 26 need not be identical, and choosing different delayperiods may reduce system overshoot. Overshoot may occur where delayelements 24 and 26 are implemented as active filters. When an activefilter receives an impulse, ringing is experienced. Two consecutiveactive filters with identical characteristics may multiply the ringing,hence multiplying the overshoot. Selecting different delay periods maycontrol overshoot by preventing unwanted ringing at the same frequenciesto be combined. However, the delay periods are preferably selected asidentical because of circuit economy considerations. FIG. 3g is a systemdiagram of an embodiment of the present invention showing theconnections of the more detailed circuits depicted in FIGS. 3a-3f.

In operation, the delayed signals on lines 25 and 27 are used to obtainan approximation of a first and second derivative of the input signalVin as further described below. As described earlier with reference toFIG. 2a, the signals entering the circuit, exiting the first delayelement 24 and exiting the second delay element 26 are labeled A, B andC respectively and correspond in FIGS. 3a-3f to the filtered inputsignal on line 23, first delayed signal on line 25, and second delayedsignal on line 27 respectively. The points labeled A, B and C alsocorrespond to the points similarly labeled on FIG. 2a. A summing block29 performs the operation A-C to obtain an approximation of a firstderivative signal V1 of the input signal Vin. This operation is referredto herein as delay line differentiation. A second summing block 28performs the inverse operation C-A to obtain a negative representationof the first derivative signal V1.

A third summing block extends similar principles to obtain anapproximate second derivative signal V2. The numerical approximation ofthe first derivative is the difference between two adjacent samples orA-B. Another first derivative is calculated by B-C. The secondderivative is calculated from the difference between the two firstderivatives, or:

    (A-B)-(B-C)=A+C-2B

Summing block 30 performs the above arithmetic operation. This operationis referred to herein as delay line double differentiation. Because thefirst and second derivatives are calculated across two delay periods,summing blocks 28 and 30 adjust the signal by a factor of two.

Obtaining the first and second derivative signals V1 and V2 in the abovemanner has several advantages over the conventional method. Inconventional systems using analog differentiators, higher frequencyresponse times differ from those at low frequency, making prediction ofpropagation times difficult. Because edge detection depends on therelative timing of zero crossings of the second derivative signal,nonuniform propagation delays over different frequencies may result ininaccuracies in determining zero crossings. Furthermore, conventionalanalog differentiation circuits exhibit little or no attenuation outsidethe bandwidth of interest.

A device according to the preferred embodiment overcomes the abovedisadvantages by utilizing the advantageous filtering properties ofdelay line differentiation. FIG. 4a is a graph showing the periodic typefrequency response 50 of a delay line differentiator corresponding tothe first summing block 28 operating upon the filtered signal on line 23and the second delayed signal on line 27. FIG. 5a is a graph showing theperiodic type frequency response 55 of a delay line doubledifferentiator corresponding to the second summing block 30 operatingupon the filtered signal on line 23 and delayed signals 25 and 27.

As shown in FIG. 4a, the frequency response 50 resulting from delay linedifferentiation is a periodic type response (often called a "comb"filter). The first null 52 of frequency response 50 is given by theformula f(min)=1/D, where D is the sum of the delay times of the twodelay elements 24 and 26 and f(min) is in Hertz. If the sum of the delaytimes is chosen so that the frequency response 50 has begun to decreaseimmediately beyond the frequencies of interest, the system has theadvantageous property of reducing the amplitude of high frequency noisecomponents while performing the differentiating function. In addition,such filtering is done with completely linear phase. In the presentembodiment, the sum of the delay times for delay elements 24 and 26 is5.5 microseconds, placing the first null 52 at approximately 182 kHz. Incomparison, the frequency response 51 of a conventional analogdifferentiator (not shown) has no similar attenuation at higherfrequencies. The difference in high frequency attenuation is shown on alinear scale in FIG. 4b which emphasizes the advantageous frequencyresponse characteristics of the preferred embodiment.

Similarly, as shown in FIG. 5a, the frequency response 55 resulting fromdelay line double differentiation is also of a comb filter variety andhas the advantageous property of reducing the amplitude of highfrequency noise components. This filtering is also done with linearphase. If the delay times for each of the delay elements 24 and 26 are2.75 microseconds each, the first null 57 of the frequency response 55will be placed at approximately 364 kHz, and the beginning of the rolloff region at about 120 kHz, just past the band of interest. Incomparison, the frequency response 56 of a conventional analog doubledifferentiator has no similar attenuation at higher frequencies. Thesame plot in linear scale is shown in FIG. 5b, showing the advantageousfrequency response characteristics of the preferred embodiment.

The roll off filtering properties of delay line differentiators aretherefore advantageously used to suppress higher frequencies. Althoughmany other types of filters exhibit a roll-off characteristic, virtuallynone which are used conventionally for the differentiation functionsdescribed herein do so with linear phase. Linear phase, as mentioned,provides the advantage of constant group delay and, consequently,minimal distortion due to the differentiation operation. In practice thegroup delay response of delay line differentiators tends to roll off athigher frequencies, as explained with reference to FIGS. 6a and 6b. Thegroup delay D1 (in FIG. 6a) resulting from delay line differentiationand the group delay D3 (in FIG. 6b) resulting from delay line doubledifferentiation are relatively constant but exhibit a slight roll off indelay response at approximately 80-85 kHz. In contrast, the group delayD2 (in FIG. 6a) of a conventional analog differentiator and the groupdelay D4 (in FIG. 6b) of a conventional analog double differentiatorvary widely over the frequency band of interest. Preferably, a delayperiod is selected for delay elements 24 and 26 so that the amount ofroll off is insignificant in the bandwidth of interest and will notreduce accuracy of detecting transitions (see, e.g., "Filter DesignHandbook" cited above).

Referring again to FIGS. 4a and 5a, it can be seen that side lobes 53and 58 are present in the respective frequency responses 50 and 55. Theside lobes 53 and 58 are regions in which less attenuation of highfrequency noise occurs. In order to reduce the size of the side lobes 53and 58 and further increase noise attenuation at high frequencies, thefour-pole transitional Gaussian 12-dB filter 22 is placed as a prefilterbetween the input signal Vin on line 21 and the first delay element 24and works in combination with the comb filtering effects described abovein order to achieve desirable overall system frequency response.Referring to FIG. 7, the frequency response 60 of the four-poletransitional Gaussian 12-dB filter 22 is shown. The frequency response60 exhibits flat group delay throughout the unitary gain portion 61 andrelatively flat group delay in the roll off region 62. Beyond thatpoint, once the frequency response 60 drops off sharply, group delay isnot constant. However, constant group delay is not important at thosefrequencies because they are beyond the operating range. Thus, the sharpdrop-off 63 of the frequency response 60 effectively suppresses the sidelobes 53 and 58 as shown on FIGS. 4a and 5a without degrading systemperformance or affecting group delay within the range of desiredoperating frequencies.

The effect of the addition of the four-pole transitional Gaussian 12-dBfilter 22 is further explained with reference to FIGS. 8a and 8b. Asshown in FIG. 8a, the frequency response 70 is the combination offrequency response 60 of the four-pole transitional Gaussian 12-dBfilter 22 and the frequency response 50 as shown on FIG. 4a. Notably,the side lobes 53 are substantially suppressed and are reduced to muchsmaller side lobes 73. In comparison, it can be seen that the frequencyresponse 71 resulting from the combination of the same four-poletransitional Gaussian 12-dB filter 22 and the frequency is response 51as shown in FIG. 4a with respect to an analog differentiator hassignificantly less attenuation at higher frequencies.

Similarly, the graph of FIG. 8b illustrates the benefit to delay linedouble differentiation resulting from the addition of the four-poletransitional Gaussian 12-dB filter 22 to the signal processing chain. Byvirtue of adding the filter 22, the side lobe 58 of the frequencyresponse 55 shown in FIG. 5a is substantially reduced to a much smallerside lobe 78. Furthermore, the frequency response 75 is much steeperthan the frequency response 55 prior to addition of the filter 22. Incomparison, the frequency response 76 of an analog double differentiatorin combination with the same four-pole transitional Gaussian 12-dBfilter 22 has significantly less attenuation at higher frequencies.

Variations of the four-pole transitional Gaussian 12-dB filter 22 may beused while still obtaining acceptable performance. For example, adifferent number of poles may be used for the filter 22. A decrease inthe number of poles may lead in some applications to a decrease inperformance (e.g., due to insufficient suppression of high frequencynoise). An increase in the number of poles may improve performance butmay also be more complicated or expensive to implement at the risk ofincreased ringing. Thus, four poles is preferred. Similarly, the filter22 may have other than a transitional Gaussian 12-dB characteristic; forexample, the filter 22 may be of an equi-ripple variety. A Gaussian typeof filter is preferred over other filters because of its favorabledrop-off characteristics (combined with its nearly linear group delay inthe passband). Other filters, such as a Chebychev filter or Besselfilter, may be underdamped or overdamped for this particularapplication, and therefore provide a filtered signal having too muchovershoot or too much dampening.

It will now be explained in more detail the operation of the circuitsthat calculate the approximate derivative signals. Operationalamplifiers X11, X12 and X14 are used to perform the adding andsubtracting functions mentioned earlier. More specifically, the seconddelayed signal on line 27 and filtered input signal on line 23 areprovided as inputs to an operational amplifier X11 which performs thefunction of subtracting filtered input signal on line 23 from seconddelayed signal on line 273 in order to provide an approximate negativefirst derivative signal on line 32. In other words, the operationalamplifier X11 performs the operation C-A mentioned above. Likewise, thesecond delayed signal on line 27 is subtracted from the filtered inputsignal on line 23 by a summing amplifier X12 in order to obtain anapproximate positive first derivative signal on line 31. In other words,the summing amplifier X12 performs the operation A-C. The capacitors C43and C45 and resistors R43 and R50 connected to the inputs of summingamplifiers X11 and X12 perform additional single-pole low pass filteringto further reduce noise leakage into the following processing stages bysuppressing the side lobes 53 shown on FIG. 4a. Such filtering is notdone with constant group delay past the critical band of interest. Thereason two summing blocks 28 and 29 are used to derive independently thenegative and positive derivative signals on lines 31 and 32 is tomaintain proper alignment of both the negative and positive derivativesignals on lines 31 and 32 with the second derivative signal V2.

An approximation of the second derivative of the input signal Vin isobtained in a similar fashion by another operational amplifier X14. Theoperational amplifier X14 adds the filtered input signal on line 23 tothe second delayed signal on line 27 and subtracts twice the firstdelayed signal on line 25 to arrive at the approximate second derivativesignal V2. In other words, operation amplifier X14 performs the A+C-2Bfunction mentioned earlier. A capacitor C48 and a resistor R32 act as asingle-pole low pass filter connected to the input of operationalamplifier X14 in order to provide additional suppression of the sidelobe 58 shown on FIG. 5.

In one embodiment, the operational amplifiers X11, X12 and X14 are modeltype TLC272 manufactured by Texas Instruments.

After the generation of the approximate first and second derivativesignals V1 and V2, the system detects zero crossings of the secondderivative signal V2 in order to determine accurately the transitions ofthe input signal Vin. Zero crossings may be determined in a mannersimilar to that described, for example, in U.S. Pat. No. 4,000,397. Asshown in FIG. 2a, a peak detector 7 receives the first derivative signalV1 and detects its peak value Vp as shown on FIG. 2b. The peak value Vpis sent to a zero crossing detector 9 that uses a percentage of the peakvalue Vp to establish a threshold VT1. The zero crossing detector 9sends zero crossing information to a decoder section 8 for decoding ofthe bar code label.

More specifically, as shown in FIG. 3g, the zero crossings of the secondderivative signal V2 may be detected by comparator 44 during intervalswhen the negative or positive first derivative signal 31 or 32 exceedthe respective thresholds VT1 and VT2 as determined by gating logic 48.As this method is more fully described in the '397 patent, only certainaspects of this embodiment will be noted. The thresholds VT1 and VT2 maybe derived from the negative or positive first derivative signal onlines 31 or 32, or both, or the second derivative signal on line 33.Preferably the threshold signals VT1 and VT2 are set independently ofone another as shown in FIG. 3g. It is desirable to set the thresholdsignals VT1 and VT2 above the noise floor yet low enough to detectsmaller amplitude humps. The threshold signals VT1 and VT2 may thereforebe set to a percentage, such as 30%, of the peak voltage Vp of the firstderivative signal V1. The derivation of the negative threshold signalVT2 will be described in detail, with the derivation of the positivethreshold signal VT1 being accomplished in a like manner. The thresholdsignal VT2 is maintained above the noise floor by a DC offset of 100 mVprovided by the voltage reference Vref through a resistor R89. The peakvalue Vp of the negative first derivative signal on line 31 is obtainedby charging a capacitor C8 when the signal on line 31 is rising andallowing the charge on the capacitor C8 to decay slowly thereafterthrough resistor R25. More specifically, the negative first derivativesignal on line 31 is connected to a capacitor C18 which connects to thebase of a transistor Q2. Transistor Q2 is biased around an operatingpoint of approximately 0.6 volts. The collector of transistor Q2 isconnected to system voltage Vcc. The emitter of transistor Q2 isconnected to the charging capacitor C8 and a decay resistor R25. Theemitter of Q2 is also connected to an operational amplifier X13 throughresistor R52. The operational amplifier X13 adds the 100 mV offset to0.3 times the peak voltage Vp (0.3×Vp) to produce the threshold signalVT2. The operational amplifier X13 may be a model type TLC272 asmanufactured by Texas Instruments.

It should be noted that while there are several ways in which to takethe first derivative signal, the preferred embodiment has the importantbenefit of maintaining proper alignment of the first and secondderivative signals V1 and V2 by generating the second derivative V2 attwice the frequency of the first derivative signal V1, as explainedfurther below. Use of two delay elements allows the first derivative tobe taken in any of three ways--that is, by calculating either (i) A-C,(ii) B-C, or (iii) A-B. Method (i), utilizing two delay elements andhence two delay periods to calculate the first derivative, yields apoorer approximation of the first derivative than methods (ii) and(iii), in which only a single delay period is utilized. It would thusappear to be most desirable to select method (ii) or (iii) to obtain thehighest accuracy of the first derivative signal V1. However, method (i)may be preferable because it results in proper alignment of the firstand second derivatives, as shown in FIG. 2b. In FIG. 2b, the peakvoltage Vp of the first derivative signal V1 is directly above the zerocrossing ZC of the second derivative signal V2. In contrast, as shown inFIG. 2c, the peak voltage Vprc of the first derivative signal V1rcderived from a conventional analog differentiator may be misaligned withthe second derivative signal V2rc, causing missed zero crossings ordetection of false zero crossings. The poorer approximation of the firstderivative in the preferred embodiment is acceptable because the precisevalue of the first derivative is not necessarily important, as the firstderivative signal V1 is used primarily for determining an enablingperiod during which zero crossings may be detected.

The system described herein also advantageously reduces sensitivity toclipping of the first derivative signal. Clipping may occur where thefirst derivative signal V1 is limited by the supply rails. Examples ofclipping are shown with respect to FIGS. 2d-2e. As shown, clipped firstderivative signal Vc1 exhibits relatively flat peaks Vp1 that causedistortion of the second derivative signal Vc2. Thus, zero crossings ofthe second derivative signal Vc2 may be distorted leading to inaccuratedecoding. Generally, clipping increases with the length of the delayperiod selected. However, clipping may also occur in conventionalsystems and is more deleterious in such systems because such methods usethe first derivative signal Vc1 to derive the second derivative signalVc2, as shown in FIG. 2e. Thus, in those systems, clipping of the firstderivative signal affects the precision of the second derivative signal.However, the described embodiment derives the second derivative signalindependently of the first derivative signal; thus, clipping of thefirst derivative signal will not impact the precision of the secondderivative signal, as shown in FIG. 2d (some clipping of the secondderivative may result from other effects such as the amplitude of theinput signal Vin). This is a major advantage particularly in handheldscanners where, because of the increasing demand for smaller supplyvoltages and greater depth of field, clipping may likely occur due tolarger ranges of input amplitudes.

A further benefit resulting from use of fixed delay intervals of delayline circuits is that the value of the second derivative V2 occurs at apredictable time after the signal enters the delay elements 24 and 26.Threshold decision limits may therefore be established based on thevalue of the filtered input signal on line 23 in advance of the edgedetection operation. Advance threshold setting results in more reliableedge detection during transient conditions, such as when a scanning beammoves from a dark colored area of a package into the light coloredbackground area of a bar code symbol.

In an embodiment where threshold signal VT1 is variable, there may beprovided an additional advantage in the reading of the initial portionof a bar code. Because the first transition of the input signal Vin willordinarily be a white-to-black (i.e, space-to-bar) transition, thesystem may set up the threshold signal VT1 with reference to thefiltered input signal on line 23 because the delay period is predictablefrom the filtered input signal on line 23 to the derivative. This methodresults in more reliable edge detection during transient conditions,such as when a scanning beam moves from a dark colored area of a packageinto the light colored background area of a bar code symbol.

A device according to the preferred embodiment of the invention maytherefore exhibit one or more of the following advantages:

attenuation of high frequency noise in a bar code scanning systemwithout the need for a relatively complex low pass filter in the signalprocessing chain;

the benefit of the second derivative detection processing with minimaldistortion due to varying group delay;

accurate reading of bar code labels by detecting zero crossings of thesecond derivative of the input signal while maintaining constant groupdelay and attenuating high frequency noise;

proper alignment of the first and second derivatives of an input signalso that the first derivative signal may be used to determine moreaccurately the zero crossings of the second derivative signal; and

suitable dynamic range of operation without enlargement of the powersupply voltage requirements while minimizing the effects of clipping ofsignal amplitudes.

FIG. 14 is a block diagram of an embodiment in which a more preciseapproximation of a second derivative of the input signal is derived fromsamples of the input signal. Although a first embodiment has beendescribed (in FIG. 3) having two delay elements, it is possible toobtain more precise estimates of the first and second derivatives byusing more delay elements 303 (although possibly with shorter delaytimes) and a higher order interpolation scheme. Examples of suitablenumerical estimation methods are given in R. W. Hamming, "NumericalMethods for Scientists and Engineers" (2d ed. 1973). These methods arebased on approximating the signal with some polynomial over some limitedrange and using the derivative of this polynomial as the estimate of thetrue derivative within the limited range.

In another alternative embodiment, edge detection is derived from thesecond derivative signal without need of the first derivative signalinformation on lines 31 and 32. Rather, delay lines are once againemployed, this time to determine the location of zero crossings of theapproximate second derivative signal V2 and detect valid transitions ofsmall amplitude. This method is explained with reference to FIGS. 9a-9c.Essentially, this method is based on the assumed presence of symmetricalsignal peaks 150 and 151 on either side of a valid zero crossing 155 ofthe second derivative signal 152 (corresponding to V2 of FIG. 2b), asshown in FIG. 9b. Two delay elements 120 and 121 are used to "sample"the second derivative signal 152 at two intervals of time. Thus, a firstdelayed second derivative signal is generated on line 131 and a seconddelayed second derivative signal is generated on line 132. These twosignals 131 and 132 are identical to the second derivative signal 152except for the fact that they are time-shifted. The circuit looks forzero crossings of the first delayed second derivative signal on line131. A zero crossing 155 is detected only when both the secondderivative signal 152 and the second delayed second derivative signal132 are outside the deadband region defined by positive threshold 153and negative threshold 154, indicating signal peaks 150 and 151 exist toeither side of zero crossing 155.

This particular technique using delay elements 120 and 121 to detectzero crossings of the second derivative signal 152 does not require useof first derivative signal information. However, it generally doesrequire knowledge of how far apart to expect the signal peaks 150 and151, 100-400 nanoseconds being typical for fixed scanners and 2-3microseconds for handheld scanners. The delay period of delay elements120 and 121 may thus be chosen based on system parameters. The absolutevalue of the delay periods are not critical, as the system need notdetect zero crossings at the exact top of the signal peaks but at anypoint while peaks 150 and 151 are outside the deadband region. Thesystem of FIG. 9a will therefore assume a valid zero crossing 155whenever a first portion of the second derivative signal 152 exceeds oneof the two thresholds 153 and 154 a predefined time before the zerocrossing 155 and a second portion of the second derivative signal 152exceeds the other of the two thresholds 153 and 154 a predefined timeafter the zero crossing 155, regardless of whether the first and secondsignal portions of the second derivative signal 152 correspond to actualidentifiable peaks 150 and 151 in the second derivative signal 152.

Because this method functions best when there is symmetric time domainresponse, it is ideally suited for use in a system in which the secondderivative signal 152 has constant group delay or linear phase response.This method also functions best with clean derivative signals and isthus ideally suited for use in a system in which the second derivativesignal 152 is derived from delay lines.

It should be noted that the positive and negative thresholds 153 and 154are not the same as the threshold signals VT1 and VT2 described inconjunction with the first derivative signal. Thresholds 153 and 154 maybe of relatively low amplitude and function to prevent the system fromproviding erroneous output when there is no input signal. The reasonthat thresholds 153 and 154 may be relatively low is because of theadvantageous noise rejection features of the described embodiment. Thesystem will not respond to a single noise glitch but only to a noisepattern that satisfies the same conditions as required to produce avalid output. In other words, in order for the system to produce aninvalid output due to noise, there must be a positive noise glitchexceeding threshold 153 followed by a zero crossing followed by anegative noise glitch below threshold 154 (or vice versa) within thetime fixed by the delay periods. Because such noise patterns are lessfrequent than single voltage spikes that would cause invalid outputs inother systems, the described embodiment is less sensitive to noise andmay therefore utilize lower thresholds. The use of lower thresholdenables more capability of detecting zero crossings where the secondderivative signal 152 is of low amplitude. In addition, this embodimentmay advantageously fix thresholds 153 and 154 in order to minimizesensitivity to clipping of the derivative signals.

An embodiment performing the above function is shown in FIG. 9a. Thesecond derivative signal 152 is sent on line 130 to a first delayelement 120 to generate a first delayed second derivative signal on line131. The output of delay element 120 is sent to a second delay element121 in order to generate a second delayed second derivative signal online 132. The second derivative signal 152 on line 130 is compared withthe positive threshold 153 on line 124 by a comparator 122. A logicalHIGH is generated by the comparator 122 when the second derivativesignal on line 130 exceeds the positive threshold 153. Similarly, whenthe second derivative signal 152 on line 130 is below the negativethreshold 154 on line 125, a comparator 123 generates a logical HIGHsignal on line 134. Likewise, when the first delayed second derivativesignal on line 131 exceeds zero, a comparator 126 generates a logicalHIGH, and when the signal on line 131 is below zero, a comparator 127generates a logical HIGH. In the same manner, when the second delayedsecond derivative signal on line 132 exceeds the positive threshold 153on line 144, a comparator 138 generates a logical HIGH on line 140, andwhen the signal on line 132 is below the negative threshold 154 on line143, a comparator 137 generates a logical HIGH on line 139. A logicalAND gate 135 generates a HIGH signal on line 141 when the secondderivative signal on line 130 exceeds the positive threshold 154, thesecond delayed second derivative signal on line 132 is below thenegative threshold 137, and the first delayed second derivative signalon line 131 exceeds zero. The AND gate 135 will switch states when thefirst delayed second derivative signal on line 131 passes through zero.Similarly, a logical AND gate 136 generates a HIGH signal on line 142when the peaks 150 and 151 exceed opposite thresholds 153 and 154 atsample times 156 and 157.

A rising edge from LOW to HIGH on output of AND gate 135 generallyindicates the beginning of a bar, and a rising edge on the output of ANDgate 136 generally indicates the end of a bar. Comparators 122 and 123are configured in the opposite manner from comparators 135 and 136, sothat the system looks for peaks of opposite polarity to either side ofthe zero crossing 155 no matter whether the first peak is positive ornegative. The information on lines 141 and 142 is sent to decoding logic(not shown) in order to decode the bar code label. The decoding logicmay employ a timer (not shown) to calculate the time difference betweenoutput signals of gates 135 and 136 so as to permit calculation of thewidths of bars and spaces.

Waveform examples of the above embodiment in operation are shown in FIG.10 corresponding to signals at selected points labelled on FIG. 9a. Asshown in FIG. 10, signals N, M, and L are identical except for theirpositions in time and correspond to the second derivative signal 152 online 130, the first delayed second derivative signal on line 131, andsecond delayed second derivative signal on line 132, respectively. Ascan be seen, the system effectively detects a zero crossing 155 at atime when the first peak 151 has been shifted back in relative time andthe second peak 150 of opposite polarity has been shifted forward inrelative time, thereby properly aligning the two peaks 150 and 151 withthe zero crossing 155. Waveform E shows the output of comparator 123 asHIGH when the second derivative signal 152 is below the negativethreshold 154. Waveform I shows the output of comparator 144 as HIGHwhen the second delayed second derivative signal on line 132 is abovethe positive threshold 153. Waveform G shows the output of comparator127 as HIGH when the first delayed second derivative signal is belowzero (the shaded portion indicating that the value is indeterminate).Waveform K shows that the output of AND gate 136 goes HIGH at the timeof the zero crossing 155.

FIG. 12 is a diagram incorporating the zero crossing method explained inFIGS. 9a-9c. The system of FIG. 12 is similar to that of FIG. 2a but, asnoted previously, functions without generating an approximation of thefirst derivative.

One problem that may be experienced with the method described in thepreceding few paragraphs is that when edges get close together, such as,for example, when two bars are separated by only a single space, theexact point of the zero crossing 155 may be difficult precisely todetermine due to intersymbol interference. This problem is explainedwith reference to FIG. 9c. A second derivative waveform 165 is showndistorted by intersymbol interference. The positive and negative signalpeaks 160 and 161 of the second derivative waveform 165 may becomeasymmetrical causing the true zero-crossing 163 to shift to a laterfalse zero crossing 164.

FIGS. 16a-16c are waveform diagrams showing in more detail howintersymbol interference may shift a true zero crossing point to a"false" zero crossing point. FIG. 16a shows a first portion 501 of thesecond derivative signal corresponding to a black-to-white edgetransition (of, e.g., a scanned bar code), and a second portion 502 ofthe second derivative signal corresponding to a white-to-blacktransition, with no interference between the first and second signalportions 501, 502. As the edges get closer together, the first signalportion 501 and second signal portion 502 begin to overlap. FIGS. 16band 16c show the resulting signal 512; for the purpose of clarity, onlythe resulting signal for the first edge is shown. FIG. 16b alsoillustrates the relative proximity of the first and second signalportions 501 and 502 leading to the creation of the resulting signal512, and further shows the "true" zero crossing point 513 (i.e., in theabsence of intersymbol interference) as compared to a "false" zerocrossing point 514 caused by the interference between the first signalportion 501 and the second signal portion 502.

At the same time that the true zero crossing point 513 is shifted, thewaveform is distorted so that the signal peaks 561 and 562 (or 160 and161 of FIG. 9c) are no longer symmetrical. As illustrated in FIG. 16c,one peak 561 is generally narrower and shorter than the other peak 562.This asymmetry can be measured and used to estimate the error introducedin the location of the zero crossing. From the reference of the detectedzero crossing 514, the true zero crossing will typically lie further inthe direction of the wider, taller peak 562 and away from the narrower,shorter peak 562.

In one technique, the amount of shift from the detected zero crossingpoint to the true zero crossing point may be estimated by calculatingthe slope 162 of the second derivative waveform 165 (as shown in FIG.9c) at the false zero crossing 164 (using the delayed signals on lines130 and 132 as points on the line) and the relative amplitude of thesignal peaks 160 and 161. FIG. 17 is a block diagram of a circuit forperforming this function. In FIG. 17, a second derivative signal 630 isprovided to a series of delay elements 620, 621 in a manner similar tothat shown in FIG. 9a. The second derivative signal 630, a first delayedrepresentation 631 thereof, and a second delayed representation 632thereof are provided to a zero crossing detector 650, which basicallyrepresents the circuitry depicted in FIG. 9a for determining thepresence of a valid zero crossing of the second derivative signal. Theremaining circuit elements in FIG. 17 are for the purpose of determiningthe amount of shift in the measured zero crossing as described below.

Detection of a valid zero crossing by the zero crossing detector 650activates signal 651 in FIG. 17. Signal 651 triggers sample-and-holdcircuits 670 and 671. The first sample-and-hold circuit 670 samples thesecond derivative signal 630 to obtain a measurement of the first peakvalue. The second sample-and-hold circuit 671 samples the second delayedrepresentation 632 to obtain a measurement of the second peak value.These measurements correspond to peaks 150 and 151 taken at sample times156 and 157, respectively, as appearing in FIG. 9b. While FIG. 9b showsthe sample times 156 and 157 occurring at the top of the signal peaks150, 151 of the second derivative signal 152, the actual sampledportions of the second derivative signal 152 may be any part of thesignal that exceeds the threshold 153 or 154. The actual sampled portiondepends on the width of the signal "humps" and the time of sampling(i.e., the time delay of delay elements 620, 621). Because the FIG. 17embodiment will not necessarily sample at the precise signal peaks, thecalculation of zero crossing shift, explained below, is generallyconsidered a rough approximation.

Sample-and-hold circuits 670 and 671 output sampled signals 672 and 673,respectively. The sampled signals 672, 673 are connected to a differencecircuit 675. The difference circuit 675 calculates a degree of asymmetry(also called the symmetry error or symmetry deviance) in the secondderivative signal in one of at least two ways. Assuming that themeasured amplitude value for the first sampled signal 672 is A_(N) andfor the second sampled signal 673 is A_(P), then the difference circuit675 in one embodiment calculates the degree of asymmetry by thefollowing formula: (A_(N) -A_(P))/(A_(N) +A_(P)). In another embodiment,the difference circuit 675 calculates the degree of asymmetry by theformula A_(N) /A_(P). In each case, the relative amplitudes of thesampled signals 672, 673 are assumed to be proportional to the degree ofasymmetry and, hence, the degree of zero crossing shift. While the twoformulas are not mathematically identical, each represents a functionwhich varies monotonically with the degree of asymmetry.

The formula A_(N) /A_(P) corresponds to a measurement of the slope ofthe second derivative signal 630. This slope is essentially the thirdderivative of the input signal Vin. The amount by which the thirdderivative deviates from the slope of the second derivative signalwithout interference indicates the amount of asymmetry in the secondderivative waveform and, hence, the amount of shift in the measured zerocrossing. The slope of the second derivative signal without interferenceis a function of the hardware and may be determined by experiment forparticular circuit values.

FIG. 20 is a graph showing the second derivative signal 512, and a line531 representing the slope of the second derivative signal 512 at themeasured zero crossing point 514. Because points on line 531 are notreadily available, the points A_(N) and A_(P) are used instead as asecondary indication of the slope of line 530. The ratio of A_(N) toA_(P) is assumed to be indicative of the degree to which the slope ofline 531 deviates from the slope of a symmetric second derivativewaveform passing through the zero point. The ratio of A_(N) to A_(P) isphysically represented in FIG. 20 by the slope of dotted line 530.

Other configurations whereby the signal peak amplitudes are obtainedwill also work. Such configurations need only use one of therepresentations of the second derivative signal if a memory element isemployed to retain the first measured amplitude value. By samplingpoints A_(N) and A_(P), however, the FIG. 17 circuit takes advantage ofthe fact that the signal peaks (or threshold-exceeding portions of thesignal) are available simultaneously by virtue of using the two delaylines 620 and 621, thereby providing "past" and "future" datasurrounding the measured zero crossing point.

The difference signal 680 output from difference circuit 675 comprisesan estimate of the zero crossing shift based on the relative amplitudesof the measured signal portions. The difference signal 680, which ispreferably digital in format, is provided as an address to a lookuptable 681 (e.g., a ROM). For each potential discrete value of thedifference signal 680, a corresponding correction factor is stored inthe lookup table 681. The lookup table 681 outputs a signal 682comprising a correction factor to the measured zero crossing.

The correction factor output from the lookup table 681 may be a digitalsignal of counts to be added or subtracted from the measured zerocrossing time, particularly where a digital counter is being used tomeasure the distance in counts between zero crossings (as mentionedpreviously). The contents of the lookup table 681 may be determinedexperimentally to compensate for any system distortions, and may bepositive, negative, or zero in value. Preferably, the asymmetrycomputation function varies monotonically with the degree of asymmetry;thus, a unique value should be provided for each degree of asymmetry.

FIG. 23 is a diagram illustrating application of a correction factorbased on the output of the lookup table 681. In FIG. 23, a time graph isshown having points t₁, t₂ and t₄ at which valid zero crossings weredetected. The first point t₁ is assumed to be correct. The value T_(m)represents the measured time (equivalent to measuring distance) betweenzero crossings detected at points t₁ and t₂. The value T_(c) representsa correction factor (positive in this case) obtained from lookup table681. The "true" zero crossing is thus taken to be point t₃ rather thanpoint t₂, and the time (or distance) between the two zero crossings istaken to be t₃ -t₁, rather than t₂ -t₁. The correction factor may beeither positive or negative, depending upon the calculated slope of thesecond derivative signal at the zero crossing and the type of transition(e.g., black-to-white or white-to-black).

Each valid zero crossing may have a correction factor applied in asimilar manner. When corrected, the new zero crossing location is usedas the reference for the following zero crossing measurement whendetermining distance between zero crossings (for purposes of, e.g.,decoding).

Detection of a valid zero crossing in the FIG. 17 embodiment also causessignal 651 to trigger a one-shot 660. The one-shot 660 switches statesfor an amount of time sufficient to allow sampling of signals 630 and632, calculation by the difference circuit 675, and retrieval of anappropriate correction factor from lookup table 681 based on differencesignal 680. When the one-shot 660 times out, it switches back to itsstable state and sends a reset signal 661 to the sample-and-holdcircuits 670, 671. Sample-and-hold circuits 670, 671 are thereby clearedto measure the next signal peak values.

As an alternative to using a lookup table 681, the correction factor maybe determined by mathematical formula. However, application of amathematical formula would require precise knowledge of the systemcharacteristics, including any non-linearities. Thus, a lookup tablewill ordinarily be preferred. The mathematical formula may be calculatedusing an analog arithmetic circuit, or digitally using a microprocessor,arithmetic logic unit (ALU), or similar device.

A second embodiment of a circuit for measuring a degree of zero crossingshift is shown in FIG. 18. In FIG. 18, a second derivative signal 730 isprovided to a series of delay elements 720, 721 in a manner similar tothat shown in FIG. 9a. The second derivative signal 730, a first delayedrepresentation 731 thereof, and a second delayed representation 732thereof are provided to a zero crossing detector 750, which basicallyrepresents the circuitry depicted in FIG. 9a for determining thepresence of a valid zero crossing of the second derivative signal. Theremaining circuit elements in FIG. 18 are for the purpose of determiningthe amount of shift in the measured zero crossing as described below.

The first delayed representation 731 is provided to a derivative circuit760, which takes a first derivative of its input. The derivative circuit760 may be either an analog RC differentiator circuit, or a time-sampleddifferentiator circuit operating according the principles ofapproximation (using F(t)-F(t-D)) described earlier herein. A derivativesignal 760 (which is the third derivative of the original input signalV_(in)) is connected to a sample-and-hold circuit 769. Thesample-and-hold circuit 769 is triggered when a valid zero crossing isdetected by the zero crossing detector 750. The sample-and-hold circuit769 thereby outputs a derivative value of the first delayedrepresentation 731 when that signal crosses the zero level.

The output 770 of the sample-and-hold circuit 769 may be digitized(e.g., by a low resolution A/D converter, not shown) and provided to alookup table 781. The lookup table 781 outputs a signal 782 comprising acorrection factor in a manner as described with respect to the FIG. 17embodiment. The contents of the lookup table 781 may be determined byexperiment, similar to the FIG. 17 embodiment. The output of thederivative circuit 760, which represents the slope of the first delayedrepresentation 731 at its zero crossing, is assumed to be indicative ofa degree of shift from the "true" zero crossing, and is therefore usedin the FIG. 18 embodiment for arriving at an appropriate correctionfactor.

FIG. 22 is a block diagram of a third circuit for determining the amountof shift of the measured zero crossing point from the "true" zerocrossing point. The FIG. 22 embodiment generally operates by determiningthe locations of the signal peaks in the second derivative signal, andcalculating the degree of asymmetry according to a formula employing aratio of the measured signal peaks. The FIG. 22 embodiment outputs acorrection factor, which may be delayed in time from detection of themeasured zero crossing point (until the trailing signal peak islocated).

In FIG. 22, the circuitry of FIG. 9a is used to detect a valid zerocrossing of the second derivative signal. The second derivative signalis also connected to line 831 in FIG. 22. (While any of the secondderivative signal or its delayed representations may be used in FIG. 22,using the actual second derivative signal is preferred for the quickestdetermination of the correction factor). Line 831 is connected to adelay element 832 and a pair of comparators 840, 841. The output 833 ofthe delay element 832 is connected to the first comparator 840 and aninverter 834. The output 835 of the inverter 834 is connected to thesecond comparator 841. Comparators 840 and 841 each compare theirrespective inputs and generate output comparison signals 842 and 843,respectively. The output comparison signals 842, 843 are provided to amicroprocessor 855 (or other suitable calculating circuit) fordetermination of the correction factor.

In operation, the delay element 832 provides a short delay of, e.g.,about one clock period (i.e., one count period of the counter used tomeasure the distance between zero crossings). The exact delay periodselected for delay element 832 depends on the expected width of thesignal pulses of the second derivative signal 831. Comparator 840compares the second derivative signal 831 with a slightly delayedversion thereof output from delay element 832. When the secondderivative signal 831 changes direction from positive to negative (or,alternatively, from negative to positive), it will cause the comparator840 to change states. The change in direction from positive to negativeindicates the presence of a positive signal peak in the secondderivative signal 831, such as peak 528 shown in FIG. 19.

Likewise, an inverse delayed second derivative signal 835 is comparedagainst the second derivative signal 831 by comparator 841. When thesecond derivative signal 831 changes direction from negative topositive, it will cause the comparator 841 to change states. The changein direction from negative to positive indicates the presence of anegative signal peak in the second derivative signal 831, such as peak529 shown in FIG. 19.

Comparators 840, 841 therefore detect the occurrences of the positiveand negative signal peaks, respectively, in the second derivative signal831. Operation of comparators 840, 841 is equivalent in some aspects tolooking for a zero crossing of the second derivative signal'sderivative. In order to reduce sensitivity to noise, the secondderivative signal 831 may be filtered (e.g, by a low pass filter) priorto its application to the circuit of FIG. 22. Alternatively, or inaddition, the comparators 840, 841 may be configured with a level ofhysteresis, which will also tend to reduce the potential for thrashing,particularly around the transition point.

The comparators 840 and 842 are connected to a logical OR gate 845, suchthat when either of the comparators 840, 842 changes state the outputsignal 846 from the OR gate 845 becomes active. Signal 846 output fromthe OR gate 845 is connected to a capture register 851, which istriggered upon activation of signal 846 to capture a count value from aclock and counter circuit 850. The count value in the capture register851 is provided to the microprocessor 855. The comparison output signals842 and 843 are also provided to the microprocessor 855. Themicroprocessor 855 reads the count value stored in the capture register851 and determines, from the comparison output signals 842 and 843,which of the comparators 840, 841 changed state (and, hence, whether apositive or negative peak was detected). The microprocessor 855 is alsoassumed to receive the time of zero crossing detection from thecircuitry of FIG. 9a.

From the information provided to the microprocessor 855, a correctionfactor may be determined as follows. The microprocessor 855 calculatesthe time difference between the occurrence of each signal peak and themeasured zero crossing point, as may be explained with reference to FIG.19. Thus, the microprocessor 855 calculates the time difference T_(N)(in clock counts) between a preceding signal peak 529 (in this example anegative peak) and the measured zero crossing point 514. Themicroprocessor 855 also calculates the time difference T_(P) (in clockcounts) between a subsequent signal peak 528 (in this example a positivepeak) and the measured zero crossing point 514. The relative occurrencein time of the preceding and subsequent signal peaks 529, 528 is assumedto be indicative of the amount of shift from the "true" zero crossingpoint.

The microprocessor 855 calculates a degree of asymmetry in the secondderivative waveform (and hence the degree of shift in the measured zerocrossing point) in one of at least two ways. In one embodiment themicroprocessor 855 calculates the degree of asymmetry by the followingformula: (T_(N) -T_(P))/(T_(N) +T_(P)). In another embodiment, themicroprocessor 855 calculates the degree of asymmetry by the formulaT_(N) /T_(P). In each case, the relative signal peak locations areassumed to be proportional to the amount of zero crossing shift. Whilethe two formulas are not mathematically identical, each represents afunction which varies monotonically with the degree of asymmetry,similar to the FIG. 17 embodiment.

When the signal is symmetric, T_(P) is equal to T_(N) and the symmetryerror is zero. Otherwise, application of either of the above twoformulas leads to a calculated symmetry error (or symmetry deviance).The calculated symmetry error may be applied to a lookup table (includedas part of microprocessor block 855) or used as part of a predefinedmathematical formula for determining a correction factor. The contentsof the lookup table, or the mathematical formula to use, may bedetermined in a manner as explained with respect to the FIG. 17embodiment.

Instead of using comparators 840 and 841, other conventional means forpeak detection (either analog or digital) may be used. Also, instead ofusing the occurrence in time of the signal peaks 528, 529, theamplitudes of the signal peaks 528, 529 may be used to determine thezero crossing shift. In such a case, when a signal peak 528 or 529 isdetected (e.g., in the manner shown in FIG. 22), the amplitude of thesecond derivative signal may be sampled (e.g., by a sample-and-holdcircuit). Signal peak amplitudes A_(N) (for the negative signal peak)and A_(P) (for the positive signal peak) may thereby be determined. Therelative signal peak amplitudes A_(N) and A_(P) may be used in the samemanner as described with respect to the FIG. 17 or FIG. 22 embodimentfor arriving at a symmetry error measurement.

Another way to determine the shift 166 of the zero crossing 163 is bymeasuring the relative pulse widths 170 and 171 of the signal 165, asshown in FIG. 9c. When the waveform is symmetric, the pulse widths 170and 171 should be identical. The difference in the pulse widths 170 and171 indicates the amount of the zero crossing shift 166.

A circuit for measuring the relative pulse widths of the secondderivative signal is shown in FIG. 24. In FIG. 24, the circuitry of FIG.9a is used to detect a valid zero crossing of the second derivativesignal. The second derivative signal is also connected to line 931 inFIG. 24. (While any of the second derivative signal or its delayedrepresentations may be used in FIG. 24, using the actual secondderivative signal is preferred for the quickest determination of thecorrection factor). Line 931 is connected to a pair of comparators 940,941. A positive threshold signal 935 is connected to the firstcomparator 940, and a negative threshold 936 is connected to the secondcomparator 941. Comparators 940 and 941 each compare their respectiveinputs and generate output comparison signals 942 and 943, respectively.The output comparison signals 942, 943 are provided to a microprocessor955 (or other suitable calculating circuit) for determination of thecorrection factor.

In operation, the positive threshold signal 935 and negative thresholdsignal 936 are set symmetrically above and below the zero referencelevel. FIG. 21 is a waveform diagram showing the presence of a positivethreshold level 540 corresponding to the positive threshold signal 935in FIG. 24, and a negative threshold level 541 equal in magnitude to thepositive threshold level 540 and corresponding to the negative thresholdsignal 936 in FIG. 24. Typically, the positive threshold level 540 andnegative threshold level 541 may be set to approximately seven times therms noise floor of the electronic system; however, a wide range of otherthreshold levels will also work. The widths of the positive and negativelobes of the second derivative signal 512 are determined by measuringthe amount of time the second derivative signal 512 is above or belowthe respective threshold level 540 or 541. These widths are denoted inFIG. 21 as W_(P) (for the positive lobe width) and W_(N) (for thenegative lobe width).

When the second derivative signal 931 exceeds the positive thresholdsignal 935, the comparator 940 switches states and remains therein untilthe second derivative signal 931 falls back below the positive thresholdsignal 935. Output comparison signal 942 is connected to a logical ORgate 945, which triggers a capture register 951 to load a count valuefrom a clock and counter circuit 950 similar to that described for theFIG. 22 embodiment. The microprocessor 955 associates the count valuewith the proper lobe by monitoring the output comparison signals 942 and943. The first count value associated with a given lobe is designated asthe lobe starting point, and the second count value associated with thesame lobe is designated as the lobe ending point. The difference betweenthe lobe starting point and the lobe ending point is calculated toarrive at the lobe width.

Comparator 941 operates in an analogous manner to comparator 940, exceptit switches state when the second derivative signal 931 drops below andthen rises back above the negative threshold signal 936. Comparatoroutput signal 943 likewise is provided to OR gate 945, which triggersthe capture register 951 to load a count value from the clock andcounter circuit 950. Because the output comparison signals 942 and 943are mutually exclusive (that is, there cannot be a positive and negativesignal lobe simultaneously), there will be no conflict over the captureregister 951 nor ambiguity with determining which of the comparators940, 941 is responsible for triggering the capture register 951.

From the information provided to the microprocessor 955, a correctionfactor may be determined as follows. The microprocessor 955 calculatesthe lobe widths (in clock counts) for both the positive and negativesignal peaks W_(P), W_(N) surrounding the zero crossing 514. Themicroprocessor 955 calculates a degree of asymmetry in the secondderivative waveform (and hence the degree of shift in the measured zerocrossing point) in one of at least two ways. In one embodiment themicroprocessor 955 calculates the degree of asymmetry by the followingformula: (W_(N) -W_(P))/(W_(N) +W_(P)). In another embodiment, themicroprocessor 955 calculates the degree of asymmetry according to theformula W_(N) /W_(P). In each case, the relative signal peak widths areassumed to be proportional to the amount of zero crossing shift. Whilethe two formulas are not mathematically identical, each represents afunction which varies monotonically with the degree of asymmetry,similar to the FIG. 17 or the FIG. 22 embodiments.

When the signal is symmetric, W_(P) is equal to W_(N) and the symmetryerror is zero. Otherwise, application of either of the above twoformulas leads to a calculated symmetry error (or symmetry deviance).The calculated symmetry error may be applied to a lookup table (includedas part of microprocessor block 955) or used as part of a predefinedmathematical formula for determining a correction factor. The contentsof the lookup table, or the mathematical formula to use, may bedetermined in a manner as explained with respect to the FIG. 17embodiment.

Other similar variations of the described techniques for detecting thezero crossing shift may also be used. Typically, each of thesevariations will involve measuring one or more of the peak amplitudes,pulse widths, or other signal characteristics indicative of the degreeof asymmetry, and applying a correction value based on the degree ofasymmetry.

While the embodiments shown so far have been related to a laser scanningbar code reader, it should be appreciated that the same circuit can beutilized in readers that have other types of signal generation methods.In particular, the electrical signal that represents the light reflectedfrom a label could come from a CCD imaging device. The characteristicsof such a signal are in pertinent respects identical to those from alaser scanner and therefore this invention can be used advantageously insuch devices to effectively process the signal for edge detection.Moreover, a CCD imaging device already has synchronous input and istherefore well suited for use with the present invention. This methodcan also be done in real time.

Another alternative embodiment may employ sample-and-hold circuits toachieve the same benefits of the delay line signal processing describedpreviously. An example of such an alternative embodiment is describedwith reference to FIGS. 13a-13f. The embodiment utilizes threesample-and-hold circuits 250-252 to sample at various intervals t0, t1,t2 . . . as shown on FIG. 13f, where the waveform 280 corresponds to theinput signal Vin. The first sample-and-hold circuit 250 samples at timeinterval t0, t3, t6, . . . , the second sample-and-hold circuit 251 attime interval t1, t4, t7, . . . , and the third sample-and-hold circuit252 at time interval t2, t5, t8, . . . Thus, at any given time thesystem has information pertaining to at least three consecutive sampletimes. The outputs of the sample-and-hold circuits 250-252 are sent toarithmetic block 208 to calculate the first and second derivativesignals V1 and V2 according to the formulas "A-C" and "A+C-2B" discussedbefore. One circuit 253 performs the first derivative calculation and asecond circuit 254 performs the second derivative calculation. Becauseonly two calculating circuits 253 and 254 are used, additional logic isnecessary to determine which sample-and-hold circuits 250-252 correspondto the A, B, and C signals at any given time and to connect the propersample-and-hold circuits to the proper inputs of calculating circuits253 and 254 at the proper time.

With reference to the embodiment shown in FIG. 13a, a controller 239provides, among other things, selective coupling of sample-and-holdcircuits 250-252 clock control 206 provides a synchronous clock signal262 to a counter 200. With each pulse of clock signal 262 the counter200 increments, transferring the system to the next state. Each newstate corresponds to a new sample period t0, t1, t2 . . . at which timethe sample-and-hold circuits 250-252 are enabled as further explainedbelow. The counter 200 is connected to an EPROM 201 which functions as alook-up table containing command data for the given state. The presentstate of the counter 200 is used as the address of the EPROM 201. Thecommand data of the EPROM 201 for the selected state is latched by latch202. The output of the latch is sent to control the CCD array 203, theenabling logic 204 for the sample-and-hold circuits 250-252 (showncollectively as the S/H block 205 on FIG. 13a), and relays REL1-REL9(shown collectively as the relay block 207 on FIG. 13a). The relaysREL1-REL9 (shown in FIG. 13d) control the connections to the calculationcircuits 253 and 254 of the arithmetic block 208. Although the describedembodiment utilizes a counter 200 and EPROM 201 to perform the commandlogic, it should be noted that a finite state machine could be easilysubstituted to perform the same function. Further, although thedescribed embodiment utilizes a CCD array input, it should be noted thatthe sample-and-hold circuits 250-252 could also operate on an analoginput signal. Further, because a CCD imaging device has an intrinsicsample-and-hold, a similar system to that described herein may becreated with only two sample-and-hold circuits while using the CCDimaging device as a substitute for the third.

The embodiment of FIG. 13a is shown with more detail in FIGS. 13b-13d.Referring to FIG. 13b, a clock signal 260 of roughly 616 kHz is providedto a J-K flip-flop 220 which is in turn connected to another J-Kflip-flop 221 for the purpose of producing a clock signal 262 at roughlyone quarter the speed, or 154 kHz. The output of the J-K flip-flop 221sends the clock signal 262 to the counter 200. The output of the counter200 is connected to the address of a 16 k×8 EPROM 201. The output ofEPROM 201 is latched by latch 202. The system clock signal 260 is alsoinverted by inverter 222 to provide an inverse clock signal for thelatch 202. The output of inverter 222 is then connected to two inverts223 and 224 separated by a capacitor Cck and a resistor Rck which delaythe signal approximately 100 ns. The output of inverter 224 is connectedto a J-K flip-flop 226 which halves the signal frequency. Thus, theoutput of the J-K flip-flop 226 is a delayed sample clock signal 263representing a delayed version of clock signal 260 at half thefrequency. As shown in FIG. 13e, the delayed sample clock signal 263provides a positive pulse during each half period of the clock signal262 which is used to control the CCD array 203. The use of the delayedclock signal 263 enables the sampling of the CCD array 203 output by thesample-and-hold circuits 250-252 after transitory conditions havesettled, thus providing a clean and accurate input signal.

The output of the latch 202 is used to control various circuitry in therest of the system. A kick signal 210 output from the latch 202 resetsthe circuitry in a known state at the beginning of a scan line. ThreeCCD control signals 211-213 are used to control the CCD array. Threelogic signals OUT0-OUT2 are used to control the enabling of thesample-and hold circuits 250-252 and the relays REL1-REL9. All threesample-and-hold signals 250-252 are connected together to receive thesource signal provided by the CCD array 203. As the threesample-and-hold circuits 250-252 alternate in collecting data, the logicsignals OUT0-OUT2 ensure that only one of the three sample-and-holdcircuits 250-252 is enabled at a given time.

With reference to FIG. 13c, the logic signals OUT0-OUT2 are individuallylogically ANDed by logic gates 240-242 with the delayed sample clocksignal 263 in order to provide enabling signals 243-245 tosample-and-hold circuits 250-252, respectively. Each of the threesample-and-hold circuits 250-252 are enabled only when its respectivesignal is high. Referring to FIG. 13e, signals 264-266 show the relativetiming patterns of enabling signals 243-245, respectively.

Referring to FIG. 13d, the relays REL1-REL9 are used to control theinputs to the calculation circuits 253 and 254. The relays REL1-REL9 maybe implemented as analog switches. The first three relays REL1-REL3connect the outputs of the sample-and-hold circuits 250-252 to theinputs of the calculation circuits 253 and 254 corresponding to the "A"input described earlier. Likewise, the next three relays REL4-REL6connect the outputs of the sample-and-hold circuits 250-252 to theinputs of the calculation circuits 253 and 254 corresponding to the "B"input described earlier. In the same manner, the final three relaysREL7-REL9 connect the outputs of the sample-and-hold circuits 250-252 tothe inputs of the calculation circuits 253 and 254 corresponding to the"C" input described earlier. Table 13-1 below shows the properconnections for each given timing period.

                  TABLE 13-1                                                      ______________________________________                                        1st Der.    2nd Deriv.    Calculations                                        ______________________________________                                        0    V.sub.2 - V.sub.φ                                                                    V.sub.2 + V.sub.φ  - 2V.sub.1                                                           A - C  C + A - 2B                               1     V.sub.3 - V.sub.1                                                                                  V.sub.3 + V.sub.1 - 2V.sub.2                                                          B - A                                                                               A + B - 2C                           2     V.sub.4 - V.sub.2                                                                                  V.sub.4 + V.sub.2 - 2V.sub.3                                                          C - B                                                                              B + C - 2A                            3     V.sub.5 - V.sub.3                                                                                  V.sub.5 + V.sub.3 - 2V.sub.4                                                          A - C                                                                               C + A - 2B                           4     V.sub.6 - V.sub.4                                                                                  V.sub.6 + V.sub.4 - 2V.sub.5                                                          B - A                                                                               A + B - 2C                           5     V.sub.7 - V.sub.5                                                                                  V.sub.7 + V.sub.5 - 2V.sub.6                                                          C - B                                                                              B + C - 2A                            6     V.sub.8 - V.sub.6                                                                                  V.sub.8 + V.sub.6 - 2V.sub.7                                                      A - C    C + A - 2B                            7     V.sub.9 - V.sub.7                                                                                  V.sub.9 + V.sub.7 - 2V.sub.8                                                          B - A                                                                               A + B - 2C                           8     V.sub.10 - V.sub.8                                                                                V.sub.10 + V.sub.8 - 2V.sub.9                                                     C - B      B + C - 2A                           9     V.sub.11 - V.sub.9                                                                                V.sub.11 + V.sub.9 - 2V.sub.10                                                       A - C                                                                                 C + A - 2B                           10   V.sub.12 - V.sub.10                                                                               V.sub.12 + V.sub.10 - 2V.sub.11                                                      B - A                                                                                  A + B - 2C                                .          .                                                                  .          .                                                                  .          .                                                             N     V.sub.(N+2) - V.sub.N                                                                       V.sub.(N+2) + V.sub.N - 2V.sub.N+1                        ______________________________________                                    

For Table 13-1, V_(N) is the voltage sampled at time period t_(N). Notethat the pattern repeats every three sample periods. A first relayenable signal 267 corresponds to OUT0 and activates relays REL3, REL4,and REL8. A second relay enable signal 268 corresponds to OUT1 andactivates relays REL1, REL5 and REL9. A third relay enable signal 269corresponds to OUT2 and activates relays REL2, REL6 and REL7. Inoperation, the first and second derivative signals V1 and V2 are outputfrom calculation circuits 253 and 254.

In another alternative embodiment, an analog shift register may be usedto store input data. During each clock period, charge is transferredfrom one capacitor to a neighboring capacitor of the analog shiftregister. In such an embodiment, the system would use the stored signalfrom three consecutive cells of the analog shift register as inputs tothe summing blocks 5 and 6 (in FIG. 2) in order to perform the samecalculations as described previously.

In yet another embodiment, as shown, for example, in FIG. 15, the delayelements 403 and 404 may be adjustable and therefore useful for widelyvarying conditions. The delay period may be dynamically adjusted toenable the reading of labels of various sizes at various distances overa wide depth of field. The delay period may be chosen as one of severaldiscrete periods or may be a continuously variable delay period.Further, the delay period may also be matched to a particular rangesetting of an adjustable-focus scanner such as described in U.S. Pat.No. 5,347,121 issued on Sep. 13, 1994, and incorporated herein byreference. Thus, a different delay period could be selected for eachrange or zone of operation. An adjustable delay line may be used such asa ladder transconducting amplifier such as manufactured by NationalSemiconductor. The low-pass filter 402 could also be dynamically variedin conjunction with the delay period in order to compensate for thedifferent expected frequencies at different ranges.

In some systems it may be desirable to include some delay responseequalization to compensate for phase nonlinearities in some other partof the system. Delay equalization may be achieved by adjusting the delayelements 24 and 26 of the embodiment described earlier in FIGS. 3a-3f.FIG. 11 is a graph showing the various ranges of delay compensation thatmay be achieved by varying the value of the delay line resistors R85 andR86 (or resistors R87 and R91) from 24kΩ to 43 kΩ. One or both of thedelay elements 24 and 26 may be so adjusted for purposes ofcompensation. Generally, it can be seen from FIG. 11 that damping ofdelay response increases with larger values of the delay line resistorsR85, R86, R87 and R91.

While the invention has thus far been described with reference to barcode label scanners, it is apparent that other systems requiring preciseedge detection of analog signals may also benefit from use of theinvention. In particular, the edge detection methods described hereinmay be advantageously applied to optical character recognition systemsin which images are obtained by detecting reflected light and anelectrical signal is generated in proportion to the detected light.

The methods and techniques described herein may also be implemented inthe digital domain without departing from the principles of theinvention. In particular, such implementations may utilize ananalog-to-digital (A/D) converter and a microprocessor or finite statemachine to perform the functions described previously. The input signalfrom the optical unit may be digitized by A/D conversion, andtransitions detected in the digitized input signal by use of amicroprocessor or similar computational device. The computational devicepreferably be embodied as a digital signal processor (DSP) chip. A DSPchip may be programmed to perform the filtering, delaying and summingoperations (and the differentiation operations) heretofore described.Adaptation of analog circuit functions to an equivalent DSP program iswell known.

While the invention has been particularly shown and described withreference to certain embodiments, it will be understood by those skilledin the art that various changes in form and detail may be made withoutdeparting from the spirit and scope of the invention.

What is claimed is:
 1. An apparatus for reading encoded imagescomprisinga symbol reader having a variable focusing distance, saidsymbol reader comprising an optical detector generating an electricalinput signal having an amplitude varying over time in response to anamount of detected light, means for conditioning said input signal andgenerating a conditioned signal thereby, and means for dynamicallymodifying electrical characteristics of said means for conditioning inresponse to changing said variable focusing distance.
 2. The apparatusof claim 1 wherein said symbol reader comprises means for activelyfocusing an outgoing laser beam to provide said variable focusingdistance.
 3. The apparatus of claim 1 wherein said means forconditioning said input signal further comprises a plurality of delayelements each outputting a delayed replica of the input signal.
 4. Theapparatus of claim 1, further comprisingan edge detector connected to anoutput of said means for conditioning said input signal, wherebytransitions in said input signal are detected, and a decoder connectedto said edge detector.
 5. The apparatus of claim 1 furthercomprisingmeans for processing said conditioned signal to identifypredefined features of said input signal, said means for conditioningcomprises at least one filter.
 6. An apparatus for reading encodedimages comprising:a symbol reader having a variable focusing distance,said symbol reader comprising an optical detector generating an inputsignal having an amplitude varying over time in response to an amount ofdetected light; means for conditioning said input signal, said means forconditioning said input signal comprising a plurality of delay elementseach outputting a delayed replica of the input signal; and means fordynamically modifying electrical characteristics of said means forconditioning in response to changing said variable focusing distance,said means for dynamically modifying electrical characteristics of saidmeans for conditioning in response to changing said variable focusingdistance comprising means for adjusting a delay period of at least oneof said plurality of delay elements.
 7. The apparatus of claim 6 furthercomprising a double differentiator calculation circuit having its inputsconnected to said delay elements and outputting an approximate secondderivative signal in response to at least selected additive andsubtractive combinations of its inputs, said second derivative signalhaving zero crossings indicative of transitions of said input signal. 8.A method for reading images, comprising the steps of:selecting a firstfocal distance for an optical symbol reader; generating from an opticaldetector a first signal having an electrical characteristic that variesover time in response to an amount of detected light; conditioning saidfirst signal using first electrical parameters selected in response tosaid first focal distance; selecting a second focal distance for theoptical symbol reader; generating from said optical detector a secondsignal having an electrical characteristic that varies over time inresponse to an amount of detected light; and conditioning said secondsignal using second electrical parameters selected in response to saidsecond focal distance.
 9. The method of claim 8 wherein said firstelectrical parameters and said second electrical parameters govern afrequency response of electrical circuitry performing said step ofconditioning said first signal and said step of conditioning said secondsignal.
 10. A method for reading images, comprising the stepsof:selecting a first focal distance for an optical symbol reader;generating from an optical detector a first signal having an electricalcharacteristic that varies over time in response to an amount ofdetected light; conditioning said first signal using parameters selectedin response to said first focal distance; selecting a second focaldistance for the optical symbol reader; generating from said opticaldetector a second signal having an electrical characteristic that variesover time in response to an amount of detected light; and conditioningsaid second signal using parameters selected in response to said secondfocal distance; wherein said step of conditioning said first signalusing parameters selected in response to said first focal distancecomprises the step of delaying said first signal for a first set ofdelay times selected in response to said first focal distance, therebygenerating a plurality of delayed replicas of said first signal, andwherein said step of conditioning said second signal using parametersselected in response to said second focal distance comprises the step ofdelaying said second signal for a second set of delay times selected inresponse to said second focal distance, thereby generating a pluralityof delayed replicas of said second signal.
 11. The method of claim 10,further comprising the step of calculating second derivatives of thefirst signal and the second signal using the plurality of delayedreplicas of said first input signal and said second signal,respectively.
 12. The method of claim 11, further comprising the step ofdetecting zero crossings of said second derivatives, thereby determiningtransitions between relatively lighter and darker portions of a targetimaged by said optical detector.
 13. A method for reading images,comprising the steps of:selecting a first focal distance for an opticalsymbol reader; generating from an optical detector a first signal havingan electrical characteristic that varies over time in response to anamount of detected light; conditioning said first signal usingparameters selected in response to said first focal distance; selectinga second focal distance for the optical symbol reader; generating fromsaid optical detector a second signal having an electricalcharacteristic that varies over time in response to an amount ofdetected light; and conditioning said second signal using parametersselected in response to said second focal distance; wherein said step ofconditioning said first signal using first electrical parametersselected in response to said first focal distance comprises adjusting atime period between sample points to match the first focal distance; andwherein said step of conditioning said second signal using secondelectrical parameters selected in response to said second focal distancecomprises adjusting the time period between sample points to match thesecond focal distance.
 14. An apparatus for reading encoded imagescomprisinga symbol reader having a plurality of focal distances, saidsymbol reader comprising an optical detector which generates an inputsignal having an amplitude varying over time in response to an amount ofdetected light; a control signal for varying an active focal distance ofthe symbol reader among said plurality of focal distances; and an inputsignal conditioning circuit connected to said input signal, said inputsignal conditioning circuit changing its operational characteristicswhen the active focal distance of the symbol reader is varied inresponse to said control signal.
 15. The apparatus of claim 14, whereinsaid plurality of focal distances comprise a discrete set of selectablefocal distances, each of said discrete set of selectable focal distancescorresponding to a distinct range of field depth.
 16. The apparatus ofclaim 15, wherein said optical detector further comprises a variableaperture mechanism for generating said discrete set of selectable focaldistances.
 17. The apparatus of claim 14, further comprising a featuremeasurement circuit connected to said input signal conditioning circuit.18. An apparatus according to claim 14 wherein said input signalconditioning circuit dynamically changing its operationalcharacteristics, said operation characteristics including at least itsfrequency response characteristics.
 19. An apparatus for reading encodedimages, comprising:a symbol reader having a plurality of focaldistances, said symbol reader comprising an optical detector whichgenerates an input signal having an amplitude varying over time inresponse to an amount of detected light; a control signal for varying anactive focal distance of the symbol reader among said plurality of focaldistances; and an input signal conditioning circuit connected to saidinput signal, said input signal conditioning circuit changing itsoperational characteristics when the active focal distance of the symbolreader is varied in response to said control signal; wherein said inputsignal conditioning circuit comprises a plurality of adjustable delayelements connected in series, said adjustable delay elements each havinga selectable delay period that is shortened or lengthened by a discreteamount when the active focal distance of the symbol reader is varied inresponse to said control signal.
 20. The apparatus of claim 19, whereineach of said adjustable delay elements comprises a laddertransconducting amplifier.
 21. The apparatus of claim 19 furthercomprising a second derivative calculation circuit connected to saidplurality of adjustable delay elements, said second derivativecalculation circuit outputting a second derivative of said input signalbased upon a predefined algebraic combination of its inputs, and a zerocrossing transition detector circuit connected to said second derivativecalculation circuit, said zero crossing transition detector circuitoutputting a signal indicating true zero crossings of said secondderivative of said input signal.
 22. A method of controlling operationof a data reader, comprising the steps of:generating an input signalusing an optical detector, said input signal having an electricalcharacteristic that varies over time in response to an amount ofdetected light; varying a focal distance of the data reader; andconditioning said input signal according to electrical parametersselected in response to the varying of said focal distance.
 23. Themethod of claim 22, wherein said step of varying a focal distancecomprises the step of dynamically selecting an active focal distancefrom among a discrete set of selectable focal distances.
 24. The methodof claim 22, further comprising the step of processing the conditionedinput signal so as to measure light and dark features of a target imagedby the optical detector.
 25. The method of claim 22 wherein said step ofconditioning said input signal comprises the step of dynamicallyselecting frequency response characteristics of conditioning circuitryin response to the varying of said focal distance.
 26. A method ofcontrolling operation of a data reader, comprising the stepsof:generating an input signal using an optical detector, said inputsignal having an electrical characteristic that varies over time inresponse to an amount of detected light; varying a focal distance of thedata reader; and conditioning said input signal according to parametersselected in response to the varying of said focal distance, wherein saidstep of conditioning said input signal according to parameters selectedin response to the varying of said focal distance comprises the step ofdelaying said input signal for a set of delay times selected in responseto an active focal distance.
 27. The method of claim 26, furthercomprising the steps of generating a plurality of delayed replicas ofsaid input signal by delaying said input signal for said set of delaytimes, and additively and subtractively combining said delayed replicasso as to derive information indicative of transitions in said electricalcharacteristic of said input signal.
 28. A data reading apparatuscomprising:an optical detector for generating an input signal having anamplitude corresponding to an amount of detected light; a controller forselecting an active focal distance of the data reading apparatus fromamong a plurality of focal distances; and a conditioning circuit actingupon said input signal, said conditioning circuit changing its operationcharacteristics based upon the active focal distance selected.
 29. Thedata reading apparatus of claim 28, further comprising a processorconnected to said conditioning circuit, said processor detectingfeatures of a target imaged by said optical detector.
 30. An apparatusaccording to claim 28 wherein said conditioning circuit changes itsfrequency response and group delay characteristics based upon the activefocal distance selected.
 31. A method for reading images, comprising thesteps of:selecting a first focal distance for an optical symbol reader;generating from an optical detector a first signal having an electricalcharacteristic that varies over time in response to an amount ofdetected light; conditioning said first signal using parameters selectedin response to said first focal distance; selecting a second focaldistance for the optical symbol reader; generating from said opticaldetector a second signal having an electrical characteristic that variesover time in response to an amount of detected light; conditioning saidsecond signal using parameters selected in response to said second focaldistance; processing the conditioned first signal so as to determine afirst set of feature characteristics of a target imaged by said opticaldetector; attempting to decode a symbol according to said first set offeature characteristics; processing the conditioned second signal so asto determine a second set of feature characteristics of the targetimaged by said optical detector; and attempting to decode a symbolaccording to said second set of feature characteristics.
 32. Anapparatus for detecting the occurrence of transitions in an inputsignal, comprising:a plurality of sample-and-hold circuits for takingsamples of the input signal, each of said sample-and-hold circuitscomprising a switch connected to a charge storage capacitor; a doubledifferentiator circuit generating an approximate second derivativesignal of the input signal by algebraically combining said samples, saiddouble differentiator circuit having a plurality of inputs; a controllerfor selectively coupling said sample-and-hold circuits to the inputs ofsaid double differentiator circuit; and a detection circuit fordetecting zero crossings of said approximate second derivative signal.33. An apparatus for reading encoded images, comprising:a symbol readerhaving a plurality of focal distances, said symbol reader comprising anoptical detector which generates an input signal having an amplitudevarying over time in response to an amount of detected light; a controlcircuit generating a control signal for varying an active focal distanceof the symbol reader among said plurality of focal distances; and aconditioning circuit for conditioning said input signal, saidconditioning circuit dynamically changing its internal operationalcharacteristics in response to the active focal distance of the symbolreader being varied by said control signal.